<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>第六课 计算属性与方法</title>
    <script src="./vue.js"></script>
</head>

<body>
    <div id="app">
        <div>{{formatNum}}</div>
        <div>{{str}}</div>
        <div>{{formatStr}}</div>
    </div>
    <script>
        new Vue({
            el:'#app',
            data:{
                num:100,
                str:'2316536461263512'
            },
            computed:{
                formatNum:function(){
                    return this.num + 200;
                },
                formatStr:function(){
                    return this.str.split('').sort().join('');
                }
            }
        });
    </script>
</body>

</html>